package org.rsbot.util;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JProgressBar;
import javax.swing.JWindow;


/* @auther Sorcermus
 * April 21, 2010 runedev
 * May 29, 2011 runedev
 */
public class SplashScreen extends JWindow {

    private static final long serialVersionUID = 7872136286561774212L;
    private JLabel name = new JLabel();
    public JProgressBar progress = new JProgressBar();
    private ImageIcon icon = new ImageIcon();

    public SplashScreen() {
        splash();

    }

    private void splash() {
        this.icon.setImage(GlobalConfiguration.getImage(
                GlobalConfiguration.Paths.Resources.SPLASH,
                GlobalConfiguration.Paths.SPLASH));
        progress.setIndeterminate(true);
        progress.setLocation(190, 130);
        progress.setSize(250, 14);
        progress.setOpaque(true);
        this.name.setSize(450, 150);
        this.name.setLocation(0, 0);
        this.name.setIcon(icon);
        this.name.add(progress);
        this.add(name);
        pack();
        this.setSize(450, 150);

    }

    public void SplashMain() {
        this.setVisible(true);

    }
}
